<?php $this->load->view('common/header'); ?>
<?php $this->load->view('common/menu'); ?>

<div class="banner_box"><img src="<?php echo image_url('1546594639.jpg'); ?>"></div>
<div class="product_list">
    <div class="title">
        <a href="/product.html" <? if(empty($id)){ ?> class="on" <?php }?>>全部</a>
        <?php if ($category) : ?>
            <?php foreach ($category as $key => $val) : ?>
                <a href="<?php echo "/product/" . $val['id'] . ".html"; ?>" <? if(isset($id) && $id == $val['id']){ ?> class="on" <?php }?> ><?php echo $val['category_name'] ?? ""; ?></a>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>
    <div class="list">
        <ul>
            <?php if ($products) : ?>
                <?php foreach ($products as $key => $val) : ?>
                    <li>
                        <a href="<?php echo "/product_show/" . $val['id'] . ".html"; ?>">
                            <img src="<?php echo $val['img'] ?? ""; ?>">
                            <span>
                                <?php echo $val['title']; ?><em></em>
                            </span>
                            <p><?php echo $val['keyword'] ?? ""; ?></p>
                        </a>
                    </li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>
    <div class="page">
        <ul><?php echo $pagination; ?></ul>
    </div>
</div>
<?php $this->load->view('common/footer'); ?>